package com.spvs.system.common;

import lombok.Getter;

import java.util.Arrays;

/**
 * @description:采购状态枚举值
 * @authoer:cuizhi
 * @createDate:2024/6/23-12:26
 */

@Getter
public enum PurchaseStateEnum {

    PURCHASE_RENT(1, "采购"),
    AOG_RENT(2, "到货"),
    install_RENT(3, "安装");


    PurchaseStateEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private Integer code;
    private String desc;

    public static PurchaseStateEnum getByFormCode(Integer code) {
        return Arrays.stream(PurchaseStateEnum.values())
                .filter(value -> value.getCode().equals(code))
                .findFirst().orElse(null);
    }
}
